﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Microsoft.Practices.Prism.Events;
using HelloWorld.Common;
using Codeplex.KinkumaFramework;
using System.Reactive.Linq;

namespace HelloWorld.GreetModule
{
    [Export]
    public class GreetModel
    {
        public IEventAggregator EventAggregator { get; private set; }

        public string Message { get; set; }

        [ImportingConstructor]
        public GreetModel(IEventAggregator ea)
        {
            this.EventAggregator = ea;
        }

        public void Greet()
        {
            this.EventAggregator.Publish(
                new Message { Text = this.Message });
        }
    }
}
